package com.spring.wx.oauth.dao;

import com.spring.wx.oauth.entity.VerifyCodeEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Copyright: yueyong (c) 2022
 *
 * @author he.shaorong
 * @version 1.0
 * @date 2022/5/2
 */
@Mapper
public interface VerifyCodeMapper {
    @Select("select * from from verify_code where mobile_phone = #{mobilePhone}")
    VerifyCodeEntity getVerifyCodeEntity(@Param(value = "mobilePhone") long mobilePhone);

    @Select("select verify_code, mobile_phone from verify_code where mobile_phone = #{mobilePhone} order by id desc limit 1")
    List<VerifyCodeEntity> getVerifyCodeEntityByMobilePhone(@Param(value = "mobilePhone") long mobilePhone);

}
